package com.baizhi.service2;

import com.baizhi.entrty.Article;
import com.baizhi.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.HashMap;
import java.util.Map;

@Service
public class ArticleService2Impl implements ArticleService2 {
    @Autowired
    private ArticleService as;

    @Override
    public Map insert(Article ar) {
        Map map = new HashMap();

        try {
            as.insert(ar);
            map.put("myinserta",true);
        } catch (Exception e) {
            map.put("myinserta",false);
            e.printStackTrace();
        }
        return map;
    }

    @Override
    public Map delete(int[] id) {
        Map map = new HashMap();

        try {
            as.delete(id);
            map.put("mydeleteaa",true);
        } catch (Exception e) {
            map.put("mydeleteaa",false);
            e.printStackTrace();
        }
        return map;
    }

}
